package com.controller;

import com.model.MyLog;
import com.service.MylogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Api("我的用户")
@RestController
@RequestMapping("/mylog")

public class MylogController {
    @Autowired
    private MylogService mylogService;

    @RequestMapping(value = "/addLog",method = RequestMethod.GET)
    public int addLog(MyLog myLog){
        System.out.println("进入用户添加方法");
        return mylogService.addMylog(myLog);
    }

    @RequestMapping(value = "/updateLog",produces ="application/json;charset=utf-8",method = RequestMethod.GET)
    public int updateLog(MyLog mylog){
        System.out.println("进入用户修改方法，修改的主键为："+mylog.getUserID());
        return mylogService.updateMyLog(mylog);
    }

    @RequestMapping(value = "/deleteLog",method = RequestMethod.GET)
    public int deleteMyLog(int userID){
        System.out.println("进入删除用户信息，主键为："+userID);
        return mylogService.deleteMyLog(userID);
    }

    @RequestMapping(value = "/getLog",produces ="application/json;charset=utf-8",method = RequestMethod.GET)
    public MyLog getlog(int userID){
        System.out.println("进入根据主键查找信息，主键为："+userID);
        return mylogService.getLog(userID);
    }

}